/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sunsite.service;

import java.util.List;
import sunsite.dao.NewsDao;
import sunsite.po.News;

/**
 *
 * @author mg
 */
public class NewsServiceImpl implements NewsService{
    private sunsite.dao.NewsDao newsDao;

    public void setNewsDao(NewsDao newsDao) {
        this.newsDao = newsDao;
    }

    public List<News> getTop5News() throws Exception {
        return newsDao.getTop5News();
    }

    public List<News> getNews(int pageNow,int newsType) throws Exception {
        return newsDao.getNews(pageNow,newsType);
    }

    public int getPageCount(int newsType) throws Exception {
        return newsDao.getPageCount(newsType);
    }

    public News getNewsById(String id) throws Exception {
        return newsDao.getNewsById(id);
    }


}
